package com.lly.songhigh.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by 李新伟 on 15/11/2.
 */
public class SearchPlay implements Parcelable {
    private int code;
    private DataEntity data;
    private String msg;
    private int page;
    private int pageCount;
    private int size;
    private int totalCount;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataEntity getData() {
        return data;
    }

    public void setData(DataEntity data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public static class DataEntity implements Parcelable {
        private long albumId;
        private String albumName;
        private List<UrlListEntity> urlList;
        private String name;
        private String singerName;
        private int singerId;
        private int songId;

        public int getSongId() {
            return songId;
        }

        public void setSongId(int songId) {
            this.songId = songId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSingerName() {
            return singerName;
        }

        public void setSingerName(String singerName) {
            this.singerName = singerName;
        }

        public int getSingerId() {
            return singerId;
        }

        public void setSingerId(int singerId) {
            this.singerId = singerId;
        }

        public static Creator<DataEntity> getCREATOR() {
            return CREATOR;
        }

        public long getAlbumId() {
            return albumId;
        }

        public void setAlbumId(long albumId) {
            this.albumId = albumId;
        }

        public String getAlbumName() {
            return albumName;
        }

        public void setAlbumName(String albumName) {
            this.albumName = albumName;
        }

        public List<UrlListEntity> getUrlList() {
            return urlList;
        }

        public void setUrlList(List<UrlListEntity> urlList) {
            this.urlList = urlList;
        }

        public static class UrlListEntity implements Parcelable {
            private String url;
            private long duration;

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public long getDuration() {
                return duration;
            }

            public void setDuration(long duration) {
                this.duration = duration;
            }

            public UrlListEntity() {
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.url);
                dest.writeLong(this.duration);
            }

            protected UrlListEntity(Parcel in) {
                this.url = in.readString();
                this.duration = in.readLong();
            }

            public static final Creator<UrlListEntity> CREATOR = new Creator<UrlListEntity>() {
                public UrlListEntity createFromParcel(Parcel source) {
                    return new UrlListEntity(source);
                }

                public UrlListEntity[] newArray(int size) {
                    return new UrlListEntity[size];
                }
            };
        }

        public DataEntity() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeLong(this.albumId);
            dest.writeString(this.albumName);
            dest.writeTypedList(urlList);
            dest.writeString(this.name);
            dest.writeString(this.singerName);
            dest.writeInt(this.singerId);
            dest.writeInt(this.songId);
        }

        protected DataEntity(Parcel in) {
            this.albumId = in.readLong();
            this.albumName = in.readString();
            this.urlList = in.createTypedArrayList(UrlListEntity.CREATOR);
            this.name = in.readString();
            this.singerName = in.readString();
            this.singerId = in.readInt();
            this.songId = in.readInt();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    public SearchPlay() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeParcelable(this.data, 0);
        dest.writeString(this.msg);
        dest.writeInt(this.page);
        dest.writeInt(this.pageCount);
        dest.writeInt(this.size);
        dest.writeInt(this.totalCount);
    }

    protected SearchPlay(Parcel in) {
        this.code = in.readInt();
        this.data = in.readParcelable(DataEntity.class.getClassLoader());
        this.msg = in.readString();
        this.page = in.readInt();
        this.pageCount = in.readInt();
        this.size = in.readInt();
        this.totalCount = in.readInt();
    }

    public static final Creator<SearchPlay> CREATOR = new Creator<SearchPlay>() {
        public SearchPlay createFromParcel(Parcel source) {
            return new SearchPlay(source);
        }

        public SearchPlay[] newArray(int size) {
            return new SearchPlay[size];
        }
    };
}
